Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 4 new findings on adc9ada. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@apex-sentinel-staging review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 finding moved to a new line on dd5f1ad. The verdict and the full list are in the summary comment.
|
Review of dd5f1ad: the suite recording route has no live run yet, and several recording paths can publish, lose or expose output they should not. CI is green, with 19 checks and none failing at this commit. The suite recording route is device-facing and changed. session-replay-video-owner.ts:77 now passes A second independent pass found the following problems. Replaying a completed 0.22 daemon-owned recording that has Teardown still assigns a legacy recording to the closing session's tenant (leased-recording-retention.ts:29). Close a leased session that holds a proof-less remote recording whose manifest names an unleased producer from a different tenant. The legacy branch at recording-outputs.ts:76 prefers the session lease's tenant and commits with no lease verifier, so the closing tenant can download it without that lease. The test at leased-recording-retention.test.ts:387-405 expects that reassignment. A later stop of the same completion omits Close now publishes tenantless recordings to the shared inventory (leased-recording-retention.ts:23). On a daemon with shared-secret auth and no auth hook, start a tenantless, unleased remote recording in an open session, then close the session during capture without Stop recovery can authorize and deliver from different manifest reads (record-runtime.ts:522). After a leased session closes, a request with no lease in the shared namespace can reach stop recovery. If the first manifest read hits a one-off I/O error, the store returns Remote recording responses expose daemon filesystem paths (record-runtime-response.ts:84). A public HTTP record start without a client out path returns the reserved host path, and with one it still returns the host Suite responses also send recording paths from the daemon filesystem (test-command.ts:389). A public The suite archive can serve recording bytes that failed producer verification (test-command.ts:436). The recorder writes directly into the attempt archive directory (session-replay-video-recording.ts:48-64). If a claimed sidecar is missing or verification has a transient error, no recording IDs are committed, but a valid primary video stays in that directory. The fixture at session-replay-command-recording-cleanup.test.ts:112-141 shows the surviving file and an archive response with no recording entries. Finalization registers the directory with the outer request's scope (request-finalization.ts:157-180), and download archives the whole directory (artifact-tracking.ts:816-830). The archive can also serve replacement bytes at the original path after the verified copy was staged. Reserve remote recording storage outside the archive tree, and materialize only verified recording files into the archive from the producer's committed outputs. The other suite artifacts should stay downloadable when a recording cannot be verified. Transient proof I/O during close can make a completed export unrecoverable (transitions.ts:135). Close during a remote recording after the backend produced valid output, with Process recovery mints new IDs for the same committed recording (artifact-file-storage.ts:178). If the daemon commits a standalone recording and loses power before the client certainly received the stop reply, the video and completed proof survive. The manifest holds only identities and Simplicity question: net production is 576 lines, under the 700-line threshold, so this is a question and not a size rejection. Could the independent IDs for archive suite recordings be dropped? The client archive already delivers them, and no client reads Not blocking, and these can be taken or left: artifact-tracking.ts:495 rebuilds capture-kit's None of the four earlier inline threads needs more work: the suite collection failure thread is fixed, because No tests, The next step is the live remote |
|
I’m keeping recording IDs in the suite result. The accepted #4970 case specifically requires the committed recording ID when cleanup finishes a late export. I’ll simplify the implementation around the original reservation, verified file identity, and deadline. A registry lookup can reuse a live ID within a daemon. Restart recovery also needs the reserved ID and a durable consumed state wherever source bytes can outlive delivery. The live Android suite run for |
|
Live Android suite evidence at |
This comment has been minimized.
This comment has been minimized.
|
Reviewed f801a3d against the findings from the earlier review at dd5f1ad (#5059 (comment)). The suite collection warning and the replay of a consumed ID are now fixed, but the new recording route has no live run and four defects remain. No conflicts are known. The live Android suite run (comment 7127154267) was taken at dd5f1ad, and it covered only the producing lease, not the 401 without it. The f801a3d delta then replaced the suite recording route: the recording is reserved in the attempt session dir, the archive gets a re-verified hard-linked copy (https://github.com/callstack/agent-device/blob/f801a3d/packages/daemon/src/sessions/recording-outputs.ts#L168), and downloads write A second independent pass found that a standalone download can remove a suite recording before archive delivery (https://github.com/callstack/agent-device/blob/f801a3d/packages/daemon/src/sessions/recording-outputs.ts#L146). A remote test with A second independent pass found that a proof retry can accept a replacement for a file that was already inspected (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/capture-admission/screen-recording-session-resource.ts#L176). Close verifies the video identity, then telemetry inspection returns EIO. The pending completion keeps the paths and timestamp but drops the video identity (lines 56-59, 124-138). If the video is replaced before the exact owner retries or suite collection runs, the verifier stats both paths afresh and commits the replacement under the original reservation and lease. Please persist the identities already established when verification is interrupted and require them to match on retry. For files still awaiting inspection, bind verification to the original finished output, or keep them unpublished when the original identity cannot be established. A second independent pass found that startup claim reconciliation can finish a proof-pending recording without its proof (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/durable-capture/transitions.ts#L196). Close saves an iOS simulator recording as open/export-proof-pending after native cleanup, and the daemon exits before releasing the device claim. At restart, claim reconciliation treats the open manifest as native work (device-claim-reconciliation.ts:161-170, 219), and the Apple runtime reattaches the stopped recorder as a restore-export handle (recording/recovery.ts:306-336). Generic recovery then force-cleans it and writes completed with no proof (durable-capture/recovery.ts:175-190, transitions.ts:340-355). An exact-owner stop then misses the pending-proof branch (record-runtime.ts:615-620) and refuses the intact export. Please teach recording reconciliation and claim inspection that export-proof-pending already settled native cleanup, leave that manifest for the proof retry, and let the device claim settle. A second independent pass found that a fenced read on the new proof-retry route can disclose a daemon path and mark transient I/O as non-retriable (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/capture-admission/screen-recording-session-resource.ts#L154). After an exact-owner stop authorizes an export-proof-pending manifest, the verifier's fenced reread can fail with a transient filesystem error. The store embeds the OS error text in an unreattachable record (durable-capture/store.ts:44-57), and the fence returns it with retriable:false (durable-capture/fence.ts:110-118, 150-155). That text can hold the manifest's absolute path, and the handler and HTTP layer forward it (record-runtime.ts:109-116, 617-620, http-server.ts:828-840). The other two reads on this path use a safe retriable error. Please separate an unreadable record from a missing or mismatched fence at fenced admission, and map transient manifest I/O to the path-free retriable proof error, keeping the native text in diagnostics. Not blocking, and these can be taken or left: export-proof-pending is stored with lifecycle 'open', so startup recovery (recovery.ts:130) tries to reattach a recording that disposal already cleaned and can mark it completed as already-missing, after which a later exact-owner stop fails non-retriably (transitions.ts:200); runtime-slot dispose no longer requests cleanup for undelivered recordings, and the expiry timers are in-process only, so after a restart nothing removes a recording or receipt unless the owner retries (artifact-tracking.ts:233); and a remote No open thread from other reviewers still applies. These can be resolved: discussion_r4678110991 and discussion_r4677434788 (only an explicit host-global start reaches the commit, which matches base 0.22, and teardown retains it without advertising it), discussion_r4676819718 (the collection warning is fixed at this head), discussion_r4676819725 (consumed or expired replay now fails with typed RESOURCE_EXPIRED), and discussion_r4676819730 (proof-less files are preserved for trusted local recovery by design, ADR 0024 section 2.5). Their links are #5059 (comment), #5059 (comment), #5059 (comment), #5059 (comment) and #5059 (comment). The 'Body rules' check was cancelled, not failed, and it only lints the PR body. One other check needs action because of its open thread on recording-outputs.ts:104, which repeats the host-global case above. All other checks pass, so CI is unlikely to be related to the code. Not verified here: tests, check:affected and live runs were not executed for this review; the run-EefCO6 receipt and the mixed-version HTTP runs are author-reported without transcripts; the third finding was not traced into the reattach outcome for a disposed recorder, which may be 'unreattachable' instead of 'missing' but writes no proof either way; released structured MCP hosts were not run to see whether they validate the output; and iOS and macOS remote recording were not exercised, although proof and archive copy are host-side and platform-neutral by code read. Before merge, the live remote |
f801a3d to
1e74b95
Compare
This comment has been minimized.
This comment has been minimized.
|
The four blockers from the earlier review (#5059 (comment)) are closed at 1e74b95, but a second independent pass found three new problems in the proof checkpoints. No conflicts. The only check that did not pass is Body rules, which was cancelled and not failed. It lints only the PR body, and the other 17 checks pass. The live A second independent pass found that the earlier substitution finding is still open for files whose first inspection failed. Close finishes a video with telemetry, saves the video identity, and gets EIO on the first telemetry stat. It then saves export-proof-pending with only the video identity (transitions.ts:194-203). If the sidecar is replaced before the retry, A second independent pass found that new proof checkpoints can expose an unreadable manifest path on remote stop. An EIO opening the manifest during the proof-progress save returns an unreattachable record with the OS message (transitions.ts:406). Only the export-proof-pending entry point supplies A second independent pass found that an EIO on the temporary-file rename for a proof checkpoint can leak paths and lose the finished export (screen-recording-session-resource.ts:136). The error escapes Of the earlier inline threads, these are fixed at this head and can be resolved: the suite collection failure handling (#5059 (comment)) and the replayed stop on a consumed or expired export (#5059 (comment)). These do not apply: proof-less legacy files stay for trusted local handling by design and are never published remotely (#5059 (comment)), and the host-global unscoped registration matches base behavior (#5059 (comment) and #5059 (comment)). Before merge, the three findings above need fixes with tests, and the cancelled Body rules check needs a re-run. The maintainer also decides on size (845 net production lines). |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on a555931. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 75899e4. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 finding moved to a new line on a37fcbd. The verdict and the full list are in the summary comment.
| case 'completed': | ||
| await transitionTerminal(params, resourcePath, envelope, { | ||
| ...params.definition.completionMetadata(authority.reattached.result), | ||
| }); | ||
| return true; | ||
| case 'missing': | ||
| await transitionTerminal(params, resourcePath, envelope, { | ||
| recoveryStatus: 'already-missing', | ||
| }); | ||
| await transitionTerminal(params, resourcePath, envelope, authority.reattached); | ||
| return true; |
There was a problem hiding this comment.
No longer raised on 39d7b51, with the code it pointed at unchanged: withdrawn, not fixed.
🟡 Minor · Startup recovery of a reattached-completed recording cannot finish it without producer proof
A recording with an open record reserved for a remote export reattaches as completed after daemon exit; transitionFinishOutcome forces alreadyCompleted, so completionMetadata is called with progress undefined and verifyRecordingExport throws missingProducerProof whenever no remoteCaptureExport fact is journaled. Both finishRecoveredDurableCapture's completed case and transitionFinishOutcome hit this refusal; the predecessor terminalized unconditionally, so recovery used to commit such records.
Suggested change
Give the recovery completion path a way to capture evidence rather than requiring it: pass a progress (or an explicit capture-evidence flag) into transitionFinishOutcome when the record is still open, or make verifyRecordingExport capture and journal identities when stored proof is absent instead of throwing missingProducerProof.
Details
Also raised here
Also raised at this location by persona senior-developer: Startup recovery of a natively-completed remote recording can never produce proof — A remote recording whose recorder finished natively while the daemon manifest is still open is recovered through transitionTerminal → transitionFinishOutcome, which passes alreadyCompleted: true so commitFinishedCapture calls completionMetadata with progress === undefined. verifyRecordingExport then hits if (!progress || ...) throw missingProducerProof() because no prior attempt stored remoteCaptureExport (only the live stop sequence, via progress.record, ever writes it), so recovery throws "Recording export is missing producer proof." every time and the record is never completed — the device claim keeps seeing a recoverable screen-recording resource and the finished export is never servable. finishRecoveredDurableCapture's 'completed' branch has the same shape. …
persona: javascript, senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
This comment has been minimized.
This comment has been minimized.
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Superseded by #5099 (direct recording exports) and #5100 (suite recording delivery, stacked on #5099). This PR retains the earlier review and validation record.
Summary
Refs #4970. Bind remote recording exports to the producing reservation, lifetime, tenant, and lease. Keep client placement and the standalone recording ID when a suite recording finishes during cleanup.
Before / after
record stopauthorizes the exact manifest. A proof retry requires the producer's file identities. Missing evidence leaves the export unpublished.LEASE_OUTPUT_MISMATCHon remote stop. Stop and download active recordings before an upgrade. Finished files remain on the daemon host for local recovery.test --record-videoholds standalone IDs while the archive copy is pending. Archive and standalone downloads consume their own outputs.Validation
39d7b51ad1passed 41 focused tests. All 13 runnable affected checks passed at the exact commit. All 16 hosted checks passed after the iOS smoke rerun. Both proof-less recovery cases failed ona37fcbd6a2.Artifact IDs derive from the reservation and stay stable on retry.
Tested the
a555931c3daemon on Pixel 7 with Android 16 and the T30.21.41client. The suite used UIAutomator. A separate snapshot verifiedandroid-helper0.22.0-dev.f801a3d546, both HTTP binary directions with the 0.22 nightly delivered matching video, chunk, and telemetry bytes.